package test3;

public class demo1 {
	public static void main(String[] args) {
		StringBuffer sb=new StringBuffer();
		//追加
		sb.append("aaa");
		System.out.println(sb.toString());
		sb.append("bbb");
		System.out.println(sb.toString());
		
		//添加
		sb.insert(0, "first");
		System.out.println(sb.toString());
		
		//替换
		sb.replace(0, 3, "ccc");
		System.out.println(sb.toString());
		
		//删除
		sb.delete(0, 2);
		System.out.println(sb.toString());
		
		//清空
		sb.delete(0, sb.length());
		System.out.println(sb.toString());
		
	}
}
